babyishfandomcom-20200214-history
CMake
| operating system = Cross-platform | programming language = C++ | genre = Software development tools | license = New BSD License | working state = Current | website = www.cmake.org }} CMake-wa kros-plätform na libörol en guŋhoi kontent softwär für männeijing softwär biulding dè proses yusing kompaila independènt dè method. "c" in "cmake" wa "cross-platform" (kros-plätform) dè yimei. Linuks päkeij für kompailiŋ päkeijs. Jigùm-dè vörçion wa 2.8.12.2. CMake is cross-platform free and open-source software for managing the build process of software using a compiler-independent method. It is designed to support directory hierarchies and applications that depend on multiple libraries. It is used in conjunction with native build environments such as make, Apple's Xcode, and Microsoft Visual Studio. It has minimal dependencies, requiring only a C++ compiler on its own build system. Històri CMake development began in the year 1999 in response to the need for a cross-platform build environment for the Insight Segmentation and Registration Toolkit (ITK). The project is funded by the United States National Library of Medicine as part of the Visible Human Project. It was partially inspired by pcmaker, which was made by Ken Martin and other developers to support the Visualization Toolkit (VTK). At Kitware, Bill Hoffman blended components of pcmaker with his own ideas, striving to mimic the functionality of Unix configure scripts. CMake was first implemented in 2000 and further developed in 2001. Continued development and improvements were fueled by the incorporation of CMake into developers’ own systems, including: * The VXL Project *The CABLE; features added by Brad King *GE Corporate R&D for support of DART Additional features were created when VTK transitioned to CMake for its build environment and for supporting ParaView. Features CMake can handle in-place and out-of-place builds, enabling several builds from the same source tree, and cross-compilation. The ability to build a directory tree outside the source tree is a key feature, ensuring that if a build directory is removed, the source file remains unaffected. Another feature of CMake is the ability to generate a cache to be used with a graphical editor, which, when CMake is run, can locate executables, files and libraries. This information goes into the cache, which can then be tailored before generating the native build files. Complicated directory hierarchies and applications that rely on several libraries are well supported by CMake. For instance, CMake is able to accommodate a project that has multiple toolkits, or libraries that each have multiple directories. In addition, CMake can work with projects that require executables to be created before generating code to be compiled for the final application. Its open-source, extensible design allows CMake to be adapted as necessary for specific projects. CMake can generate makefiles for many platforms and IDEs including Unix, Windows, Mac OS X, OS/2, MSVC, Cygwin, MinGW and Xcode. Microsoft Visual Studio CMake scripts can produce Microsoft Visual Studio project and solution files. However, CMake syntax is more oriented towards Unix/Linux makefiles which is rather unfriendly for Visual Studio development which relies primarily on project->properties GUI. Build process The build process with CMake takes place in two stages. First, standard build files are created from configuration files. Then the platform's native build tools are used for the actual building. Each build project contains a CMakeLists.txt file in every directory that controls the build process. The CMakeLists.txt file has one or more commands in the form COMMAND (args...), with COMMAND representing the name of each command and args the list of arguments, each separated by white space. While there are many built-in rules for compiling the software libraries (static and dynamic) and executables, there are also provisions for custom build rules. Some build dependencies can be determined automatically. Advanced users can also create and incorporate additional makefile generators to support their specific compiler and OS needs. Example CMake file if (${UNIX}) set (DESKTOP $ENV{HOME}) else() set (DESKTOP $ENV{USERPROFILE}/Desktop) endif() set (PRJ ${DESKTOP}/common/svn ) set (FILELIST ${PRJ}/src/source.txt ) message(STATUS "CMAKE_GENERATOR : ${CMAKE_GENERATOR}") message(STATUS "DESKTOP : ${DESKTOP}") message(STATUS "PRJ : ${PRJ}") message(STATUS "FILELIST : ${FILELIST}") message(STATUS "SYSTEM_NAME : ${CMAKE_SYSTEM_NAME}") project(project_name) include_directories( ${PRJ}/src ${PRJ}/includes ) # Load SRC Variable from file file(READ ${FILELIST} SRC) string(REGEX REPLACE "#.*$" "" SRC ${SRC}) string(REPLACE "\n" ";" SRC ${SRC}) add_executable(${PROJECT_NAME} ${SRC} ) foreach (f ${SRC}) set_source_files_properties(${f} PROPERTIES LANGUAGE CXX) endforeach(f) if (${WIN32}) link_directories( ) add_definitions( -DDEFINE1 ) target_link_libraries( ${PROJECT_NAME} wsock32.lib ) endif() Notable applications that use CMake * Allegro library * AliRoot - HEP package being used by ALICE LHC experiment at CERN * Armadillo - linear algebra library * Avidemux * awesome - window manager * BCI2000 * Blender * BRL-CAD * Bullet Physics Engine * Chicken Scheme * Chipmunk physics engine * CLion * Compiz * Conky Conky README.cmake file * cURL * Deal.II * Doomsday Engine * Dust Racing 2D * Drishti * Ettercap * Falcon (programming language) * FlightGear Flight Simulator * Gammu * GDCM * Geant4 * Gmsh * GNU Radio * GROMACS * Hiawatha (web server) * Hypertable * Hugin * iCub robot and YARP * IGSTK * Insight Segmentation and Registration Toolkit (ITK) * KDE SC 4 *KeePass * KiCad * libpng * LAPACK * LLVM and Clang * LMMS * Mir * MiKTeX * MLPACK - machine learning library * MuseScore * MySQL and MariaDB * OGRE * OpenSceneGraph * OpenSync * OpenCV * OpenCog * Orthanc * Point Cloud Library * Polycode * Poppler * PvPGN * QGIS * Qt5 * Raw Therapee * ReactOS * ROOT * ROS * Scribus * Second Life * SFML * Spring RTS * SuperTux * Synergy * Slicer * Stellarium * Trilinos * UHD * Vortexje * The Visualization Toolkit and ParaView * VXL * zlib * PCSX2 * Zdoom * ZMQ Päkeijs $ sudo apt-get install cmake Reading package lists... Done Building dependency tree Reading state information... Done The following additional packages will be installed: * cmake-data * libjsoncpp1 Suggested packages: * codeblocks * eclipse * ninja-build The following NEW packages will be installed # cmake # cmake-data # libjsoncpp1 0 to upgrade, 3 to newly install, 0 to remove and 23 not to upgrade. Need to get 3,916 kB of archives. After this operation, 20.5 MB of additional disk space will be used. Do you want to continue? Y/n Dawnloudiŋ #Get: http://hk.archive.ubuntu.com/ubuntu xenial-updates/main i386 cmake-data all 3.5.1-1ubuntu2 kB #Get: http://hk.archive.ubuntu.com/ubuntu xenial/main i386 libjsoncpp1 i386 1.7.2-1 kB #Get: http://hk.archive.ubuntu.com/ubuntu xenial-updates/main i386 cmake i386 3.5.1-1ubuntu2 kB Fetched 3,916 kB in 1s (2,177 kB/s) Instoliŋ (Reading database ... 256386 files and directories currently installed.) Selecting previously unselected package cmake-data. Preparing to unpack .../cmake-data_3.5.1-1ubuntu2_all.deb ... Unpacking cmake-data (3.5.1-1ubuntu2) ... Selecting previously unselected package libjsoncpp1:i386. Preparing to unpack .../libjsoncpp1_1.7.2-1_i386.deb ... Unpacking libjsoncpp1:i386 (1.7.2-1) ... Selecting previously unselected package cmake. Preparing to unpack .../cmake_3.5.1-1ubuntu2_i386.deb ... Unpacking cmake (3.5.1-1ubuntu2) ... Setiŋ Processing triggers for man-db (2.7.5-1) ... Processing triggers for libc-bin (2.23-0ubuntu3) ... Setting up cmake-data (3.5.1-1ubuntu2) ... Setting up libjsoncpp1:i386 (1.7.2-1) ... Setting up cmake (3.5.1-1ubuntu2) ... Processing triggers for libc-bin (2.23-0ubuntu3) ... Rileiten päkeijs # apt-cache search cmake *cmake - cross-platform, open-source make system **cmake-data - CMake data files (modules, templates and documentation) **cmake-dbg - debugging symbols for CMake **cmake-doc - extended documentation in various formats for CMake *libdlrestrictions-dev - development files for the DLRestrictions library *libwibble-dev - Library of various useful C++ code *xutils-dev - X Window System utility programs for development *bear - generate compilation database for Clang tooling *cmake-curses-gui - curses based user interface for CMake (ccmake) *cmake-qt-gui - Qt4 based user interface for CMake (cmake-gui) *fp-utils - Free Pascal - utilities dependency package *fp-utils-2.6.2 - Free Pascal - utilities *icmake - Intelligent C-like MAKEr, or the ICce MAKE utility. **icmake-doc - Documentation files for icmake *kdevelop-pg-qt - LL(1) parser generator based on Qt *libconsole-bridge0.2 - console bridge - library **libconsole-bridge-dev - console bridge - development files **libconsole-bridge0.2-dbg - console bridge - debugging symbols *libghc-highlighting-kate-dev - syntax highlighting library based on Kate syntax descriptions **libghc-highlighting-kate-doc - library documentation for highlighting-kate; documentation **libghc-highlighting-kate-prof - highlighting-kate library with profiling enabled; profiling libraries *libkfilemetadata-dev - library for extracting file metadata -- development files *libktorrent-dev - development files for the KTorrent Library *libresample1 - real-time audio resampling library - shared libraries **libresample1-dev - real-time audio resampling library - development files *libsdformat-dev - Simulation Description Format (SDF) parser - Development files *liburdfdom-dev - URDF DOM - development files *plasma-widget-makestatus - Plasma widget that shows the status of CMake builds *qtcreator-plugin-cmake - CMake plugin for Qt Creator IDE **qtcreator-plugin-cmake-dev - Qt Creator cmake plugin development files **qtcreator-plugin-valgrind-dev - Qt Creator valgrind plugin development files # cmake3 Ùntil Ubuntu 14.10 nigè vörçion, cmake wa difàult instolen yusiŋ 2.8 nigè vörçion. If neidè Linuks dè vörçion wa 32bit, nei keyi ùpgreidiŋ tu cmake3 wa possibol wiŧ meŧod diskraip folowen : : export fn=/tmp/cmake.sh && ls $fn && (echo "use previous $fn? Enter for yes, ctrl+d for no." && read) || (wget -O $fn http://www.cmake.org/files/v3.0/cmake-3.0.2-Linux-i386.sh 1>&2) && (cd /opt && sudo bash ${fn} && echo sudo ln -f -s /opt/cmake*/bin/cmake /usr/local/bin/cmake && cd -) Akkordiŋ tu cmake3 dè fayllist, cmake3 dè 64-bit Linuks vörçion wa mwu . Mac OS X (Darwin) wa onli 64-bit vörçion aveilàbol. Ribiulding cmake rikwair clang. Instoliŋ cmake3 on ubuntu ls: cannot access /tmp/cmake.sh: No such file or directory --2014-11-24 17:56:41-- http://www.cmake.org/files/v3.0/cmake-3.0.2-Linux-i386.sh Resolving www.cmake.org (www.cmake.org)... 66.194.253.19 Connecting to www.cmake.org (www.cmake.org)|66.194.253.19|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 23133413 (22M) text/x-sh Saving to: ‘/tmp/cmake.sh’ 100% > 23,133,413 266KB/s in 2m 30s 2014-11-24 17:59:12 (150 KB/s) - ‘/tmp/cmake.sh’ saved 23133413/23133413 sudo: unable to resolve host BKTKOWKS2 CMake Installer Version: 3.0.2, Copyright © Kitware This is a self-extracting archive. The archive will be extracted to: /opt If you want to stop extracting, please press . CMake - Cross Platform Makefile Generator Copyright 2000-2014 Kitware, Inc. Copyright 2000-2011 Insight Software Consortium All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the names of Kitware, Inc., the Insight Software Consortium, nor the names of their contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --More-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ------------------------------------------------------------------------------ The above copyright and license notice applies to distributions of CMake in source and binary form. Some source files contain additional notices of original copyright by their contributors; see each source for details. Third-party software packages supplied with CMake under compatible licenses provide their own copyright notices documented in corresponding subdirectories. ------------------------------------------------------------------------------ CMake was initially developed by Kitware with the following sponsorship: * National Library of Medicine at the National Institutes of Health as part of the Insight Segmentation and Registration Toolkit (ITK). * US National Labs (Los Alamos, Livermore, Sandia) ASC Parallel Visualization Initiative. * National Alliance for Medical Image Computing (NAMIC) is funded by the National Institutes of Health through the NIH Roadmap for Medical Research, Grant U54 EB005149. * Kitware, Inc. Do you accept the license? yN: By default the CMake will be installed in: "/opt/cmake-3.0.2-Linux-i386" Do you want to include the subdirectory cmake-3.0.2-Linux-i386? Saying no will install in: "/opt" Yn: Using target directory: /opt/cmake-3.0.2-Linux-i386 Extracting, please wait... Unpacking finished successfully sudo ln -f -s /opt/cmake-3.0.2-Linux-i386/bin/cmake /usr/local/bin/cmake # Rikompailiŋ $ ./configure --------------------------------------------- , Copyright 2000-2014 Kitware, Inc. Found Clang toolchain C compiler on this system is: clang C++ compiler on this system is: clang++ Makefile processor on this system is: make clang++ is GNU compiler clang++ has setenv clang++ has unsetenv clang++ does not have environ in stdlib.h clang++ has STL in std:: namespace clang++ has ANSI streams clang++ has streams in std:: namespace clang++ has sstream clang++ has operator!=(string, char*) clang++ has stl iterator_traits clang++ has standard template allocator clang++ has allocator<>::rebind<> clang++ does not have non-standard allocator<>::max_size argument clang++ has stl containers supporting allocator objects clang++ has stl wstring clang++ has header cstddef clang++ requires template friends to use <> clang++ supports member templates clang++ has standard template specialization syntax clang++ has argument dependent lookup clang++ has struct stat with st_mtim member clang++ has ios::binary openmode clang++ has ANSI for scoping --------------------------------------------- clang++ -I/home/tom/Downloads/cmake-3.0.2/Bootstrap.cmk -I/home/tom/Downloads/cmake-3.0.2/Source -I/home/tom/Downloads/cmake-3.0.2/Bootstrap.cmk -c /home/tom/Downloads/cmake-3.0.2/Source/cmStandardIncludes.cxx -o cmStandardIncludes.o clang++ -I/home/tom/Downloads/cmake-3.0.2/Bootstrap.cmk -I/home/tom/Downloads/cmake-3.0.2/Source -I/home/tom/Downloads/cmake-3.0.2/Bootstrap.cmk -c /home/tom/Downloads/cmake-3.0.2/Source/cmake.cxx -o cmake.o clang++ -I/home/tom/Downloads/cmake-3.0.2/Bootstrap.cmk -I/home/tom/Downloads/cmake-3.0.2/Source -I/home/tom/Downloads/cmake-3.0.2/Bootstrap.cmk -c /home/tom/Downloads/cmake-3.0.2/Source/cmakemain.cxx -o cmakemain.o clang++ -I/home/tom/Downloads/cmake-3.0.2/Bootstrap.cmk -I/home/tom/Downloads/cmake-3.0.2/Source -I/home/tom/Downloads/cmake-3.0.2/Bootstrap.cmk -c /home/tom/Downloads/cmake-3.0.2/Source/cmcmd.cxx -o cmcmd.o clang++ -I/home/tom/Downloads/cmake-3.0.2/Bootstrap.cmk -I/home/tom/Downloads/cmake-3.0.2/Source -I/home/tom/Downloads/cmake-3.0.2/Bootstrap.cmk -c /home/tom/Downloads/cmake-3.0.2/Source/cmCommandArgumentLexer.cxx -o cmCommandArgumentLexer.o clang++ -I/home/tom/Downloads/cmake-3.0.2/Bootstrap.cmk -I/home/tom/Downloads/cmake-3.0.2/Source -I/home/tom/Downloads/cmake-3.0.2/Bootstrap.cmk -c /home/tom/Downloads/cmake-3.0.2/Source/cmCommandArgumentParser.cxx -o cmCommandArgumentParser.o clang++ -I/home/tom/Downloads/cmake-3.0.2/Bootstrap.cmk -I/home/tom/Downloads/cmake-3.0.2/Source -I/home/tom/Downloads/cmake-3.0.2/Bootstrap.cmk -c /home/tom/Downloads/cmake-3.0.2/Source/cmCommandArgumentParserHelper.cxx -o cmCommandArgumentParserHelper.o clang++ -I/home/tom/Downloads/cmake-3.0.2/Bootstrap.cmk -I/home/tom/Downloads/cmake-3.0.2/Source -I/home/tom/Downloads/cmake-3.0.2/Bootstrap.cmk -c /home/tom/Downloads/cmake-3.0.2/Source/cmDefinitions.cxx -o cmDefinitions.o clang++ -I/home/tom/Downloads/cmake-3.0.2/Bootstrap.cmk -I/home/tom/Downloads/cmake-3.0.2/Source -I/home/tom/Downloads/cmake-3.0.2/Bootstrap.cmk -c /home/tom/Downloads/cmake-3.0.2/Source/cmDepends.cxx -o cmDepends.o clang++ -I/home/tom/Downloads/cmake-3.0.2/Bootstrap.cmk -I/home/tom/Downloads/cmake-3.0.2/Source -I/home/tom/Downloads/cmake-3.0.2/Bootstrap.cmk -c /home/tom/Downloads/cmake-3.0.2/Source/cmDependsC.cxx -o cmDependsC.o clang++ -I/home/tom/Downloads/cmake-3.0.2/Bootstrap.cmk -I/home/tom/Downloads/cmake-3.0.2/Source -I/home/tom/Downloads/cmake-3.0.2/Bootstrap.cmk -c /home/tom/Downloads/cmake-3.0.2/Source/cmDocumentationFormatter.cxx -o cmDocumentationFormatter.o clang++ -I/home/tom/Downloads/cmake-3.0.2/Bootstrap.cmk -I/home/tom/Downloads/cmake-3.0.2/Source -I/home/tom/Downloads/cmake-3.0.2/Bootstrap.cmk -c /home/tom/Downloads/cmake-3.0.2/Source/cmPolicies.cxx -o cmPolicies.o In file included from /home/tom/Downloads/cmake-3.0.2/Source/cmPolicies.cxx:6: In file included from /home/tom/Downloads/cmake-3.0.2/Source/cmVersionMacros.h:15: /home/tom/Downloads/cmake-3.0.2/Bootstrap.cmk/cmVersionConfig.h:4:23: warning: missing terminating '"' character -Winvalid-pp-token #define CMake_VERSION "3 ^ /home/tom/Downloads/cmake-3.0.2/Bootstrap.cmk/cmVersionConfig.h:5:1: error: expected unqualified-id .0 ^ /home/tom/Downloads/cmake-3.0.2/Bootstrap.cmk/cmVersionConfig.h:7:1: warning: missing terminating '"' character -Winvalid-pp-token " ^ 2 warnings and 1 error generated. make: *** cmPolicies.o Error 1 --------------------------------------------- Error when bootstrapping CMake: Problem while running make --------------------------------------------- Log of errors: /home/tom/Downloads/cmake-3.0.2/Bootstrap.cmk/cmake_bootstrap.log --------------------------------------------- $ Instol with brew $ sudo brew install cmake > Installing cmake dependency: xz > Downloading https://homebrew.bintray.com/bottles/xz-5.2.1.mavericks.bottle.tar.gz ######################################################################## 100.0% > Pouring xz-5.2.1.mavericks.bottle.tar.gz �� /usr/local/Cellar/xz/5.2.1: 59 files, 1.7M > Installing cmake > Downloading https://homebrew.bintray.com/bottles/cmake-3.2.1.mavericks.bottle.tar.gz ######################################################################## 100.0% > Pouring cmake-3.2.1.mavericks.bottle.tar.gz �� /usr/local/Cellar/cmake/3.2.1: 1845 files, 31M Si osou * List of build automation software * GNU build system * premake * SCons * Waf Riförènses Ikstörnol liŋk * CMake home page * Kitware * CDash * CMake Examples Wiki * CMake Tools for Visual Studio * The Architecture of Open Source Applications: CMake Category:Biuld òtomeiçion Category:Kompailiŋ tūls Category:Linuks päkeij